<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
		xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
		<title> TravelDream - Gestione prodotti base: Crea alloggio</title>
		<link href="../webApp/style.css" rel="stylesheet" type="text/css" > </link>
</h:head>
<h:body>
	<div>
		<ui:include src="../webApp/headerImpiegato.xhtml" />
		<div id='bodyContainer'>
			<br />
			<div id='container'>
			<span id='title'>Alloggio</span><hr id="titlehr"/>
			<h:form>
			<h:panelGrid columns="3" id="regGrid">
				Nome alloggio
				<p:inputText id="name" value="#{accommodationManager.name}" />
				<p:message errorStyle="color:red" for="name" />
				Indirizzo
				<p:inputText id="address" value="#{accommodationManager.address}" />
				<p:message errorStyle="color:red" for="address" />
				Data check in
				<p:calendar value="#{accommodationManager.checkInDate}" id="checkInDate" pattern="dd/MM/yyyy">
					<f:convertDateTime pattern="dd/MM/yyyy" /> 		
 				</p:calendar>
				<p:message errorStyle="color:red" for="checkInDate" />
				Data check out 
				<p:calendar value="#{accommodationManager.checkOutDate}" id="checkOutDate" pattern="dd/MM/yyyy">
					<f:convertDateTime pattern="dd/MM/yyyy" /> 		
 				</p:calendar>
				<p:message errorStyle="color:red" for="checkOutDate" />
				Prezzo xx,xx
				<p:inputText  id="price" value="#{accommodationManager.price}">
				      <f:convertNumber pattern="#,##0.00;(#,##0.00)" />
				</p:inputText>
				<p:message errorStyle="color:red" for="price" />
				Rating
				<p:selectOneMenu id="rating" value="#{accommodationManager.rating}">
					<f:selectItem itemLabel="1" itemValue="1" />
            		<f:selectItem itemLabel="2" itemValue="2" />
            		<f:selectItem itemLabel="3" itemValue="3" />
           			 <f:selectItem itemLabel="4" itemValue="4" />
           			 <f:selectItem itemLabel="5" itemValue="5" />
				</p:selectOneMenu>
				<p:message errorStyle="color:red" for="rating" />
				Status
		        <p:selectOneRadio id="status" value="#{accommodationManager.status}">
          		  <f:selectItem itemLabel="Disponibile" itemValue="true" default="true"/>
          		  <f:selectItem itemLabel="Non disponibile" itemValue="false" />
     	 	    </p:selectOneRadio>
				
				<p:commandButton action="#{accommodationManager.create()}" value="Salva" />
			</h:panelGrid>
			</h:form>
			</div>
			<br />
		</div>		
		<ui:include src="../webApp/footer.xhtml" />
	</div>
</h:body>
</html>